package com.okaysoft.ofb

class Client {

    String name
    Long parentId
    String code
    String description
    
    static constraints = {
        parentId(nullable: true)
        code(nullable: true)
        description(nullable: true)
    }
    
    String clientParentName() {
        if(this.parentId) {
            return Client.get(this.parentId).name
        }
    }
}
